export const scale = (el: HTMLElement, binding: any) => {
  let scaleNumber = binding.value
  let originColor = binding?.arg
  let parentNode = el.parentNode
  let child = Array.from(parentNode.childNodes) as HTMLElement[]
  el.style['transition'] = 'all 0.3s'
  let timer
  el.addEventListener('click', () => {
    console.log(originColor + '!important')
    child.forEach(node => {
      node.style['transform'] = 'scale(1)'
      el.style['fontWeight'] = '400'
      el.style.color = originColor
    })
    if (timer) return
    timer = setTimeout(() => {
      el.style['transform'] = `scale(${scaleNumber ?? 1.1})`
      el.style['fontWeight'] = "700"
      el.style['color'] = 'balck'
    });
    timer = setTimeout(() => {
      timer = null
    }, 300);
  })
  console.log()
}